import os

_state = {
    'counter': 0,
    'active': True,
    'work_dir': os.path.dirname(os.path.abspath(__file__)),
    'yaml_dir': None,
    'yaml': None,
    'version': '1.0.x'
}

def create_global_context():
    class ContextManager:
        @property
        def work_dir(self):
            return _state['work_dir']
        
        @property
        def output_dir(self):
            return _state['output_dir']
        
        @output_dir.setter
        def output_dir(self, dir):
            _state['output_dir'] = dir

        @property
        def version(self):
            return _state['version']
        
        @property
        def yaml_dir(self):
            return _state['yaml_dir']

        @yaml_dir.setter
        def yaml_dir(self, dir):
            _state['yaml_dir'] = dir

        @property
        def yaml(self):
            return _state['yaml']

        @yaml.setter
        def yaml(self, yaml):
            _state['yaml'] = yaml
    
    return ContextManager()

